﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Event.Default;
using Peak.Core;

namespace Peak.Data
{
  public class PostLoadEventListener : DefaultPostLoadEventListener
  {
    public override void OnPostLoad(NHibernate.Event.PostLoadEvent @event)
    {
      if (@event.Entity is IHasBusinessRules)
      {
        (@event.Entity as IHasBusinessRules).SetRulesEnabled(true);
      }
      base.OnPostLoad(@event);
    }
  }
}
